// reduces
import {INCREAMENT,DECREAMENT}from '../constant'
export default function countReducer(preState = 0, action) {
  console.log("countReducer", preState, action);
  const { data, type } = action;
  switch (type) {
    case INCREAMENT:
      // 有return就不用break
      return data + preState;
    case DECREAMENT:
      return -data + preState;
    default:
      return preState;
  }
}
